package com.xms.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;

/**
 * <p>
 * CollectionUtil
 * </p>
 *
 * @author migo
 * @since 2021/9/3
 */
public class CollectionUtil {
    public static <T> boolean notEmpty(Collection<T> data){
        return data != null && !data.isEmpty();
    }

    public static boolean notEmpty(ArrayList data){
        return data != null && !data.isEmpty();
    }

    public static boolean notEmpty(Object... data){
        return data != null && data.length > 0;
    }

    public static <T> boolean isEmpty(HashMap data){
        return data == null || data.isEmpty();
    }

    public static <T> boolean notEmpty(HashMap data){
        return data != null && !data.isEmpty();
    }

    public static <T> boolean isEmpty(Collection<T> data){
        return data == null || data.isEmpty();
    }

    public static boolean isEmpty(Object... data){
        return data == null || data.length == 0;
    }
}
